import java.util.ArrayList;
import java.util.List;


class Book{
    String name;
    int price;

    public Book(String name, int price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}

public class Main {
    public static void main(String[] args) {
        List arrayList=new ArrayList();
        arrayList.add(new Book("xx",12));
        arrayList.add(new Book("xx",10));
        arrayList.add(new Book("xx",13));
        for (int i = 0; i < arrayList.size(); i++) {
            for (int j = 0; j < arrayList.size()-i-1; j++) {
                Book book1=(Book) arrayList.get(j);
                Book book2=(Book) arrayList.get(j+1);
                if (book1.price>book2.price){
                    arrayList.set(j,book2);
                    arrayList.set(j+1,book1);
                }
            }
        }
        for (int i = 0; i < arrayList.size(); i++) {
            System.out.println(arrayList.get(i));
        }
    }
}